import { LoadingOutlined } from '@ant-design/icons';
import classNames from 'classnames';
import { HTMLAttributes } from 'react';

import classes from './index.module.less';
type Props = {
  children?: React.ReactNode;

  loading?: boolean;
} & HTMLAttributes<HTMLDivElement>;

const RyButton: React.FC<Props> = ({ children, loading, ...props }) => {
  return (
    <div {...props} className={classNames(classes.wrap, props.className)}>
      {loading && <LoadingOutlined className={classes.loading} />}
      {children}
    </div>
  );
};

export default RyButton;
